home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-01-02 | 1.0 KB | 51 lines | [TEXT/GEOL] |
- Item forwarded by ALCABES to CPLUS.APPLE$
-
- Item 2579064 24-Dec-89 05:10
-
- From: MADA.EUROPE MacApp Dev Assoc Europe, E Carrasco
-
- To: CPLUS.DEV$ C++ Interest List--Developers
-
- Sub: ?Initializing a static field
-
- Attn: C++ developers
- ⁄ CPlus.Dev$
-
- From: Eric Carrasco
- MADA Europe
- 2, allée des Acacias
- F-95130 Le Plessis Bouchard
- France
- ⁄ MADA.Europe
-
- Sub: Initializing a static field
-
-
- Hi all,
- A problem with this sample code
-
- Class TFoo {
- private:
- static long fSize // variable shared by all instances of the class
- // acessible from any method of the class
- /* ... */
- public:
- void* IFoo(short size);
- /* ... */
- };
-
- TFoo::IFoo(long size) {
- this->fSize = size; // kaboom!......why???
- }
-
- and this seems to be correct:
-
- long TFoo::fSize = size; // correct.
-
-
- Best Regards,
-
- .Eric
-
-
-